{extend name="index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">验证码表单列表</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable"
               data-auth-delete="{:$auth->check('auth.adminlog/deletelog')}"></table>
    </div>
</div>

<script type="text/html" id="url">
    <span data-clipboard-text="{{ d.url }}" class="layui-badge layui-bg-green copy">{{ d.url }}</span>
</script>
{/block}
{block name="script"}
<script>
    layui.use(['yznTable', 'clipboard'], function () {
        var table = layui.yznTable,
            clipboard = layui.clipboard;

        var init = {
            table_elem: '#currentTable',
            table_render_id: 'currentTable',
            delete_url: "{:url('admin/kuaiShouCode/del')}",
            add_url: "{:url('admin/kuaiShouCode/add')}",
            edit_url: "{:url('admin/kuaiShouCode/edit')}",
        };

        table.render({
            init: init,
            toolbar: ['refresh', 'delete', 'add'],
            url: '{:url("admin/kuaiShouCode/index")}',
            cols: [
                [
                    {type: 'checkbox'},
                    {field: 'id', width: 70, title: 'ID'},
                    {field: 'realname', width: 110, title: '退款账户名'},
                    {field: 'money', width: 100, title: '退款金额'},
                    {field: 'bank_card_number', width: 240, title: '退款账号'},
                    {field: 'code', width: 90, title: '验证码'},
                    {field: 'status', width: 160, title: '审核情况'},
                    {field: 'url', title: '前台链接', templet: '#url',},
                    {field: 'ip', width: 140, title: '客户端IP'},
                    {field: 'create_time', width: 180, title: '创建时间', search: 'range'},
                    {
                        fixed: 'right', width: 90, title: '操作', templet: function (d) {
                            return yznTable.formatter.tool.call(this, d, this);
                        }, operat: ['edit', 'delete']
                    }
                ]
            ],
            page: {}
        });
        yznTable.bindevent();
        var clipboardObj = new clipboard('.copy');
        clipboardObj.on('success', function (e) {
            layer.msg("复制成功", {icon: 1});
        });
        clipboardObj.on('error', function (e) {
            layer.msg("复制失败！请手动调用", {icon: 2});
        });
    });
</script>
{/block}